﻿namespace JxcLite.Services;

/// <summary>
/// 系统统计报表模块服务接口。
/// </summary>
public interface IReportService : IService
{
    /// <summary>
    /// 分页查询业务单据表头和表体展开明细信息。
    /// </summary>
    /// <param name="criteria"></param>
    /// <returns></returns>
    Task<PagingResult<BillDetailInfo>> QueryBillDetailsAsync(PagingCriteria criteria);

    /// <summary>
    /// 分页查询商品利润表信息。
    /// </summary>
    /// <param name="criteria"></param>
    /// <returns></returns>
    Task<PagingResult<ProfitInfo>> QueryProfitsAsync(PagingCriteria criteria);
}

class ReportService(Context context) : ServiceBase(context), IReportService
{
    public Task<PagingResult<BillDetailInfo>> QueryBillDetailsAsync(PagingCriteria criteria)
    {
        return ReportRepository.QueryBillDetailsAsync(Database, criteria);
    }

    public Task<PagingResult<ProfitInfo>> QueryProfitsAsync(PagingCriteria criteria)
    {
        return ReportRepository.QueryProfitsAsync(Database, criteria);
    }
}